package com.wicket.okrapp.web.contorller;

import com.wicket.okrapp.biz.service.QuestionService;
import com.wicket.okrapp.biz.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.res.*;
import com.wicket.okrapp.common.ro.OkrResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 * 
 * @version 1.0
 */
@RestController
@RequestMapping("/app/question/")
public class QuestionController {

  @Autowired
  QuestionService questionService;
/**
   * D3查询问题详情(公共)
   */
    @PostMapping("queryQuestionDetailCom")
    public OkrResult<QueryQuestionDetailComRespDto> queryQuestionDetailCom(@RequestBody @Validated QueryQuestionDetailComReqDto reqDTO){
    return OkrResult.success(questionService.queryQuestionDetailCom(reqDTO));
    }
/**
   * D3查询问题列表(公共)
   */
    @PostMapping("queryQuestionListCom")
    public OkrResult<QueryQuestionListComRespDto> queryQuestionListCom(@RequestBody @Validated QueryQuestionListComReqDto reqDTO){
//    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        // TODO: 2023/11/13 手写代码 
        QueryQuestionListComRespDto retData = questionService.queryQuestionListCom(reqDTO);

//        retData.setPageNum(page.getPageNum());
//        retData.setPageSize(page.getPageSize());
//        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }
/**
   * D3修改问题(公共)
   */
    @PostMapping("updateQuestionCom")
    public OkrResult<UpdateQuestionComRespDto> updateQuestionCom(@RequestBody @Validated UpdateQuestionComReqDto reqDTO){
    return OkrResult.success(questionService.updateQuestionCom(reqDTO));
    }
/**
   * D3删除问题
   */
    @PostMapping("deleteQuestion")
    public OkrResult<DeleteQuestionRespDto> deleteQuestion(@RequestBody @Validated DeleteQuestionReqDto reqDTO){
    return OkrResult.success(questionService.deleteQuestion(reqDTO));
    }
/**
   * D3存档问题
   */
    @PostMapping("archiveQuestion")
    public OkrResult<ArchiveQuestionRespDto> archiveQuestion(@RequestBody @Validated ArchiveQuestionReqDto reqDTO){
    return OkrResult.success(questionService.archiveQuestion(reqDTO));
    }
/**
   * D3-更新问题逾期相关(公共)
   */
    @PostMapping("refreshProblemOverdueRelateCom")
    public OkrResult<RefreshProblemOverdueRelateComRespDto> refreshProblemOverdueRelateCom(@RequestBody @Validated RefreshProblemOverdueRelateComReqDto reqDTO){
    return OkrResult.success(questionService.refreshProblemOverdueRelateCom(reqDTO));
    }
/**
   * D3查询相同的问题列表(公共)
   */
    @PostMapping("querySameQuestionListCom")
    public OkrResult<QuerySameQuestionListComRespDto> querySameQuestionListCom(@RequestBody @Validated QuerySameQuestionListComReqDto reqDTO){
    return OkrResult.success(questionService.querySameQuestionListCom(reqDTO));
    }
/**
   * D3新增问题(公共)
   */
    @PostMapping("addQuestionCom")
    public OkrResult<AddQuestionComRespDto> addQuestionCom(@RequestBody @Validated AddQuestionComReqDto reqDTO){
    return OkrResult.success(questionService.addQuestionCom(reqDTO));
    }
/**
   * D3新增问题业务处理(公共)
   */
    @PostMapping("addQuestionBusinessProcessingCom")
    public OkrResult<AddQuestionBusinessProcessingComRespDto> addQuestionBusinessProcessingCom(@RequestBody @Validated AddQuestionBusinessProcessingComReqDto reqDTO){
    return OkrResult.success(questionService.addQuestionBusinessProcessingCom(reqDTO));
    }
/**
   * D3删除问题(公共)
   */
    @PostMapping("deleteQuestionCom")
    public OkrResult<DeleteQuestionComRespDto> deleteQuestionCom(@RequestBody @Validated DeleteQuestionComReqDto reqDTO){
    return OkrResult.success(questionService.deleteQuestionCom(reqDTO));
    }
/**
   * D3修改问题业务处理(公共)
   */
    @PostMapping("updateQuestionBusinessProcessingCom")
    public OkrResult<UpdateQuestionBusinessProcessingComRespDto> updateQuestionBusinessProcessingCom(@RequestBody @Validated UpdateQuestionBusinessProcessingComReqDto reqDTO){
    return OkrResult.success(questionService.updateQuestionBusinessProcessingCom(reqDTO));
    }
/**
   * D3删除问题业务处理(公共)
   */
    @PostMapping("deleteQuestionBusinessProcessingCom")
    public OkrResult<DeleteQuestionBusinessProcessingComRespDto> deleteQuestionBusinessProcessingCom(@RequestBody @Validated DeleteQuestionBusinessProcessingComReqDto reqDTO){
    return OkrResult.success(questionService.deleteQuestionBusinessProcessingCom(reqDTO));
    }
/**
   * D3-更新问题已过时长(公共)
   */
    @PostMapping("refreshQuestionPassDurationCom")
    public OkrResult<RefreshQuestionPassDurationComRespDto> refreshQuestionPassDurationCom(@RequestBody @Validated RefreshQuestionPassDurationComReqDto reqDTO){
    return OkrResult.success(questionService.refreshQuestionPassDurationCom(reqDTO));
    }
/**
   * D3执行问题等级转消息提示层级(公共)
   */
    @PostMapping("implementQuestionLevelConvertMsgLevelCom")
    public OkrResult<ImplementQuestionLevelConvertMsgLevelComRespDto> implementQuestionLevelConvertMsgLevelCom(@RequestBody @Validated ImplementQuestionLevelConvertMsgLevelComReqDto reqDTO){
    return OkrResult.success(questionService.implementQuestionLevelConvertMsgLevelCom(reqDTO));
    }
/**
   * D3执行更新问题状态及消息与数量(公共)
   */
    @PostMapping("implementUpdateQuestionStatusMsgNumCom")
    public OkrResult<ImplementUpdateQuestionStatusMsgNumComRespDto> implementUpdateQuestionStatusMsgNumCom(@RequestBody @Validated ImplementUpdateQuestionStatusMsgNumComReqDto reqDTO){
    return OkrResult.success(questionService.implementUpdateQuestionStatusMsgNumCom(reqDTO));
    }
/**
   * D3分析问题状态业务操作类型(公共)
   */
    @PostMapping("analysisQuestionStatusBizOptTypeCom")
    public OkrResult<AnalysisQuestionStatusBizOptTypeComRespDto> analysisQuestionStatusBizOptTypeCom(@RequestBody @Validated AnalysisQuestionStatusBizOptTypeComReqDto reqDTO){
    return OkrResult.success(questionService.analysisQuestionStatusBizOptTypeCom(reqDTO));
    }
/**
   * D3执行问题消息标题接收变量(公共)
   */
    @PostMapping("implementQuestionMsgTitleReceiveVariableCom")
    public OkrResult<ImplementQuestionMsgTitleReceiveVariableComRespDto> implementQuestionMsgTitleReceiveVariableCom(@RequestBody @Validated ImplementQuestionMsgTitleReceiveVariableComReqDto reqDTO){
    return OkrResult.success(questionService.implementQuestionMsgTitleReceiveVariableCom(reqDTO));
    }
}
